<?php include show_tpl('public_uheader.htm'); ?>

<div style="width:100%; height:20px; background:#E9ECF3;"></div>
	
<?php include show_tpl('public_usider.htm'); ?>

<div id="page-wrapper" class="gray-bg">
               
	<div class="row wrapper wrapper-content">
		<div class="row" style=" height:auto; overflow:hidden;">
			<div class="col-md-12">
				<div class="row">
					<div class="col-md-3 col-xs-6">
						<div class="panel">
							<div class="panel-body brand-danger" style="background:#F05033;">
								<div class="text-center">
									<span class="img-circle">
										<i class="fa fa-user fa-3x">
										</i>
									</span>
								</div>
							</div>
							<div class="panel-body">
								<h4 class="pull-left">
									账户余额
								</h4>
								<h4 class="pull-right text-danger">
									<?php echo round($user['coin'], 3);?> 元
								</h4>
							</div>
						</div>
					</div>
					<div class="col-md-3 col-xs-6">
						<div class="panel">
							<div class="panel-body brand-primary" style="background:#3498DB;">
								<div class="text-center">
									<span class="img-circle">
										<i class="fa fa-usd fa-3x">
										</i>
									</span>
								</div>
							</div>
							<div class="panel-body">
								<h4 class="pull-left">
									今日收入
								</h4>
								<h4 class="pull-right text-primary">
									<?php echo order_income_today($uid); ?> 元
								</h4>
							</div>
						</div>
					</div>
					<div class="col-md-3 col-xs-6">
						<div class="panel">
							<div class="panel-body brand-info" style="background:#8E44AD;">
								<div class="text-center">
									<span class="img-circle">
										<i class="fa fa-bar-chart fa-3x">
										</i>
									</span>
								</div>
							</div>
							<div class="panel-body">
								<h4 class="pull-left">
									今日交易
								</h4>
								<h4 class="pull-right text-info">
									<?php echo order_count_today($uid); ?> 笔
								</h4>
							</div>
						</div>
					</div>
					<div class="col-md-3 col-xs-6">
						<div class="panel">
							<div class="panel-body brand-info" style="background:#1FA67A;">
								<div class="text-center">
									<span class="img-circle">
										<i class="fa fa-diamond fa-3x">
										</i>
									</span>
								</div>
							</div>
							<div class="panel-body">
								<h4 class="pull-left">
									已付金额
								</h4>
								<h4 class="pull-right text-info">
									<?php echo round($user['tj_cash'], 2); ?> 元
								</h4>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="row" style=" height:auto; overflow:hidden;">

			<div class="col-lg-6 col-md-12">
				<div class="row">
					<div class="col-md-12">
						<div class="panel">
							<div class="row">
								<div class="alert alert-warning" style="margin-bottom:0;">
									<span class="fa fa-info" style="margin-left:30px;"></span>
										&nbsp;您当前的账号结算周期为：
										<span class="label label-success">D+0</span>
										&nbsp;&nbsp;进入申请结算才可以划入余额提现。
									</div>
								</div>
							</div>
						</div>
						<div class="col-md-12">
							<div class="panel panel-default">
								<div class="panel-heading">
									<h4 class="panel-title">
										<em class="fa fa-bell-o fa-fw">
										</em>
										最新公告
									</h4>
								</div>
								<div class="panel-body">
									<div class="list-group">    
										<?php foreach($notice as $n){ ?>
										<a data-toggle="modal" href="<?php echo url('article-modal-'.$n['id']);?>" data-target="#myModal" class="list-group-item">
											<span class="pull-right">[<?php echo date('m-d', $n['time']);?>]</span>
											<em class="fa fa-fw fa-volume-up mr"></em>
											<?php echo $n['title'];?>
										</a>
										<?php } ?>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>

				<div class="col-lg-6 col-md-12">
					<div class="row">
						<div class="col-md-12">
							<div class="panel panel-default">
								<div class="panel-heading">
									<h4 class="panel-title">
										<em class="fa fa-clock-o fa-fw"></em>
										最近登录日志
									</h4>
								</div>
								<div class="panel-body">
									<div class="table-responsive">
										<table class="table table-striped table-bordered table-hover">
											<thead>
												<tr>
													<th class="text-center">登陆时间</th>
													<th class="text-center">登陆IP</th>
												</tr>
											</thead>
                                            <tbody>
												<?php foreach($login_log as $l){ ?>
												<tr>
													<td class="text-center"><?php echo date('Y-m-d H:i:s', $l['time']);?></td>
													<td class="text-center"><?php echo $l['detail'];?></td>
												</tr>
												<?php } ?>
											</tbody>
                                        </table>
									</div>
								</div>
								<div class="panel-footer text-right">
									<a href="<?php echo url('user-log-login');?>" class="btn btn-default btn-sm">
										查看更多
									</a>
								</div>
							</div>
							<div class="panel panel-default">
								<div class="panel-heading">
									<h4 class="panel-title">
										<em class="fa fa-clock-o fa-fw">
										</em>
										结算记录TOP5
									</h4>
								</div>
								<div class="panel-body">
									<div class="table-responsive">
										<table class="table table-striped table-bordered table-hover">
											<thead>
												<tr>
													<th class="text-center">提交时间</th>
													<th class="text-center">结算金额</th>
													<th class="text-center hidden-cx">手续费</th>
													<th class="text-center">结算模式</th>
													<th class="text-center">状态</th>
												</tr>
											</thead>
                                            <tbody>
												<?php foreach($cash_log as $c){ ?>
                                              	<?php $span = $c['status']=='已审核' ? '<span style="color:#27ae60;">' :'<span style="color:#ea413c">'; ?>
												<tr>    
													<td class="text-center"><?php echo date('Y-m-d H:i:s',$c['time']);?></td>
													<td class="text-center"><?php echo round($c['coin'], 2);?></td>
													<td class="text-center"><?php echo round($c['fee'], 2);?></td>
													<td class="text-center"><?php echo $c['bank'];?></td>
													<td class="text-center"><?php echo $span.$c['status'];?></span></td>
												</tr>	
												<?php } ?>
											</tbody>
										</table>
									</div>
								</div>                 
								<div class="panel-footer text-right">
									<a href="<?php echo url('user-log-cash'); ?>" class="btn btn-default btn-sm">
										查看更多
									</a>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<?php include show_tpl('public_ufooter.htm'); ?>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
<script>
$("#myModal").on("hidden.bs.modal", function() {
	$(this).removeData("bs.modal");
});
</script>